package com.zlj.accountant.db.dao;

import java.sql.SQLException;
import java.util.List;
import java.util.UUID;

import android.util.Log;

import com.zlj.accountant.db.entity.TAccountFund;

public class AccountFundInternalService extends MainService<TAccountFund> {
	
	private static final String tag = AccountFundInternalService.class.getName();

	public AccountFundInternalService(DBHelper db) {
		super(db);
	}
	
//	@Publish(Mode.Private)
	public void save(TAccountFund entity){
		try{
			createOrUpdate(entity);
        }
        catch(SQLException e){
        	Log.e(tag, e.getMessage());
        	throw new RuntimeException(e);
        }		
	}

//	@Publish(Mode.Private)
	public TAccountFund getAccountFund(UUID id){
		
		try{
	        return get(id);
        }
        catch(SQLException e){ 
	        Log.e(tag, e.getMessage());
	        throw new RuntimeException(e);
        }
	}
	
//	@Publish(Mode.Private)s
	public List<TAccountFund> getAccountFundList(){
		List<TAccountFund> result;
        try{
	        result = getList();
	        return result;
        }
        catch(SQLException e){
        	Log.e(tag, e.getMessage());
        	throw new RuntimeException(e);
	    }
	}

}
